import request from '@/utils/request'

export const getAllBlogs = () => request.get('/blogs/allcover')
export const getMyBlogsById = (id) => request.get(`blogs/${id}`)

export const readBlog = (id) => request.get(`/blogs/getOne/${id}`)

export const searchBlogs = (title) => request.get(`/blogs/searchBlogs/${title}`)

export const deleteBlogById = (id) => request.delete(`/blogs/${id}`,)

export const insertBlog = (blog) => request.post('/blogs', blog)